#ifndef _M_BLEPRPH_H_
#define _M_BLEPRPH_H_

#include <stdbool.h>
#include <stdio.h>
#include "esp_wifi.h"


#ifdef __cplusplus
extern "C" {
#endif

struct ble_hs_cfg;
struct ble_gatt_register_ctxt;


#define CHAR1_MAX_DATALEN           32
#define CHAR2_MAX_DATALEN           64
#define CHAR3_MAX_DATALEN           50
#define CHAR4_MAX_DATALEN           5
#define CHAR5_MAX_DATALEN           50

typedef struct
{
    uint8_t ble_char1_WifiName[32];
    uint8_t ble_char2_WifiPassword[64];
    uint8_t ble_char3_IP[50];
    uint8_t ble_char4_Port[5];
    uint8_t ble_char5_StaticIP[50];

    uint16_t ble_char1_WifiName_len;
    uint16_t ble_char2_WifiPassword_len;
    uint16_t ble_char3_IP_len;
    uint16_t ble_char4_Port_len;
    uint16_t ble_char5_StaticIP_len;
}ble_esp32_param_t;


#define SPP_DATA_MAX_LEN           (512)

///Attributes State Machine
enum{
    SPP_IDX_SVC,

    SPP_IDX_SPP_CHAR1_CHAR,
    SPP_IDX_SPP_CHAR1_VAL,

    SPP_IDX_SPP_CHAR2_CHAR,
    SPP_IDX_SPP_CHAR2_VAL,

    SPP_IDX_SPP_CHAR3_CHAR,
    SPP_IDX_SPP_CHAR3_VAL,

    SPP_IDX_SPP_CHAR4_CHAR,
    SPP_IDX_SPP_CHAR4_VAL,

    SPP_IDX_SPP_CHAR5_CHAR,
    SPP_IDX_SPP_CHAR5_VAL,

    SPP_IDX_NB,
};

void ble_init(void);


#ifdef __cplusplus
}
#endif

#endif
